Control canonical links in load_stac_from_job#916
Open
Silvren wants to merge 2 commits into
Open
Conversation
soxofaan
reviewed
Jul 17, 2026
soxofaan
left a comment
Member
There was a problem hiding this comment.
hi, thanks for you contribution
already looks good,
some notes and suggestions
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
Silvren
force-pushed
the
agent/control-job-canonical-link
branch
from
July 17, 2026 08:06
2382325 to
bae852d
Compare
Author
|
Thanks for the review. I addressed all four suggestions:
I also rebased onto the latest |
soxofaan
reviewed
Jul 17, 2026
| :param spatial_extent: limit data to specified bounding box or polygons | ||
| :param temporal_extent: limit data to specified temporal interval. | ||
| :param bands: limit data to the specified bands | ||
| :param use_canonical_link: control use of the canonical result link: |
Member
There was a problem hiding this comment.
Suggested change
| :param use_canonical_link: control use of the canonical result link: | |
| :param use_canonical_link: control use of the canonical link: |
| :param temporal_extent: limit data to specified temporal interval. | ||
| :param bands: limit data to the specified bands | ||
| :param use_canonical_link: control use of the canonical result link: | ||
| ``"auto"`` prefers it but falls back to the regular job results URL, |
Member
There was a problem hiding this comment.
Suggested change
| ``"auto"`` prefers it but falls back to the regular job results URL, | |
| ``"auto"`` prefers it but falls back to the unsigned job results URL, |
| :param use_canonical_link: control use of the canonical result link: | ||
| ``"auto"`` prefers it but falls back to the regular job results URL, | ||
| ``"require"`` fails if it is unavailable, and ``"avoid"`` always uses | ||
| the regular job results URL. |
Member
There was a problem hiding this comment.
Suggested change
| the regular job results URL. | |
| the unsigned job results URL. |
| try: | ||
| job_results = job.get_results() | ||
|
|
||
| canonical_links = [ |
Member
There was a problem hiding this comment.
refactor this logic into BatchJob.get_results_metadata_url with an additional toggle argument canonical: bool=False
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
canonical_linkmode toConnection.load_stac_from_job"auto": prefer a canonical link and fall back to the regular results URL"require"to fail fast when no signed canonical link can be obtained"avoid"to use the regular results URL without fetching result metadataTesting
python -m pytest tests/rest/test_connection.py::TestLoadStac -q(65 passed)pre-commit run --files CHANGELOG.md openeo/rest/connection.py tests/rest/test_connection.pyFixes #634